package com.greenhouse.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.greenhouse.business.domain.BizCropsManage;
import com.greenhouse.business.mapper.BizCropsManageMapper;
import com.greenhouse.business.service.IBizCropsManageService;
import com.greenhouse.common.utils.DateUtils;

/**
 * 农产品管理Service业务层处理
 * 
 * @author greenhouse
 * @date 2021-05-14
 */
@Service
public class BizCropsManageServiceImpl implements IBizCropsManageService {
	@Autowired
	private BizCropsManageMapper bizCropsManageMapper;

	/**
	 * 查询农产品管理
	 * 
	 * @param id 农产品管理ID
	 * @return 农产品管理
	 */
	@Override
	public BizCropsManage selectBizCropsManageById(Long id) {
		return bizCropsManageMapper.selectBizCropsManageById(id);
	}

	/**
	 * 查询农产品管理列表
	 * 
	 * @param bizCropsManage 农产品管理
	 * @return 农产品管理
	 */
	@Override
	public List<BizCropsManage> selectBizCropsManageList(BizCropsManage bizCropsManage) {
		return bizCropsManageMapper.selectBizCropsManageList(bizCropsManage);
	}

	/**
	 * 新增农产品管理
	 * 
	 * @param bizCropsManage 农产品管理
	 * @return 结果
	 */
	@Override
	public int insertBizCropsManage(BizCropsManage bizCropsManage) {
		bizCropsManage.setCreateTime(DateUtils.getNowDate());
		return bizCropsManageMapper.insertBizCropsManage(bizCropsManage);
	}

	/**
	 * 修改农产品管理
	 * 
	 * @param bizCropsManage 农产品管理
	 * @return 结果
	 */
	@Override
	public int updateBizCropsManage(BizCropsManage bizCropsManage) {
		bizCropsManage.setUpdateTime(DateUtils.getNowDate());
		return bizCropsManageMapper.updateBizCropsManage(bizCropsManage);
	}

	/**
	 * 批量删除农产品管理
	 * 
	 * @param ids 需要删除的农产品管理ID
	 * @return 结果
	 */
	@Override
	public int deleteBizCropsManageByIds(Long[] ids) {
		return bizCropsManageMapper.deleteBizCropsManageByIds(ids);
	}

	/**
	 * 删除农产品管理信息
	 * 
	 * @param id 农产品管理ID
	 * @return 结果
	 */
	@Override
	public int deleteBizCropsManageById(Long id) {
		return bizCropsManageMapper.deleteBizCropsManageById(id);
	}
}
